package org.codehaus.mojo.l10n;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class L10nFile {
	private final File source;
	private final String locale;
	private Properties properties;
	private int keyCount;
	private int missingKeyCount;

	public void readProperties() throws IOException {
		FileInputStream inputStream = new FileInputStream(source);
		properties = new Properties();
		properties.load(inputStream);
	}

	public L10nFile(String locale, File source) {
		this.locale = locale;
		this.source = source;
	}

	@Override
	public String toString() {
		return "<l10nFile source=\"" + source + "\" locale=\"" + locale + "/>";
	}

	public File getSource() {
		return source;
	}

	public String getLocale() {
		return locale;
	}

	public Properties getProperties() {
		return properties;
	}

	public int getMissingKeyCount() {
		return missingKeyCount;
	}

	public void setMissingKeyCount(int missingKeyCount) {
		this.missingKeyCount = missingKeyCount;
	}

	public int getKeyCount() {
		return keyCount;
	}

	public void setKeyCount(int propertyCount) {
		this.keyCount = propertyCount;
	}
}
